package org.example.comment.feign;


import org.example.dto.OrderDto;
import org.example.entity.Order;
import org.example.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "OrderService")
public interface OrderFeign {
    @PostMapping("/order/addOrder")
    public Result addOrder(@RequestBody OrderDto orderDto);


    @GetMapping("/order/getOrderByOrderId/{orderId}")
    public Result<Order> getOrderById(@PathVariable("orderId") Long orderId);


    @GetMapping("/order/getOrderByUserId/{userId}")
    public Result<List<Order>> getOrderByUserId(@PathVariable("userId") Long userId);
}
